package com.example.demo.vo;

import com.diboot.core.binding.annotation.*;
import com.example.demo.entity.Orders;
import com.example.demo.entity.Customer;
import com.diboot.file.entity.UploadFile;
import com.example.demo.entity.Express;
import com.diboot.iam.entity.IamUser;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.util.List;

/**
* 订单 DetailVO定义
* @author MyName
* @version 1.0
* @date 2024-03-04
 * Copyright © MyCompany
*/
@Getter @Setter @Accessors(chain = true)
public class OrdersDetailVO extends Orders  {
    private static final long serialVersionUID = 3723599089530325267L;

    /**
    * 关联字段 客户.名称：Customer.name 
    */
    @BindField(entity = Customer.class, field = "name", condition = "this.customer_id=id")
    private String customerName;

    /**
    * 关联对象 客户：Customer
    */ 
    @BindEntity(entity = Customer.class, condition = "this.customer_id=id")
    private Customer customer;
		
    /**
    * 关联单文件上传
    */ 
    @BindEntity(entity = UploadFile.class, condition = "this.id=rel_obj_id AND rel_obj_type='Orders' AND rel_obj_field='fileurl'")
    private UploadFile fileurlFile;

    /**
    * 关联字典：ORDERSTATUS
    */
    @BindDict(type=DICT_ORDERSTATUS, field="status")
    private String statusLabel;

    /**
    * 关联字段 名字：Express.name 
    */
    @BindField(entity = Express.class, field = "name", condition = "this.express_id=id")
    private String expressName;

    /**
    * 关联字段 系统用户.真实姓名：IamUser.realname 
    */
    @BindField(entity = IamUser.class, field = "realname", condition = "this.create_by=id")
    private String createByName;

    /**
    * 关联字段 系统用户.真实姓名：IamUser.realname 
    */
    @BindField(entity = IamUser.class, field = "realname", condition = "this.update_by=id")
    private String updateByName;

}